package cn.buk.flight.dao;

import cn.buk.common.sc.CommonSearchCriteria;
import cn.buk.common.sc.Page;
import cn.buk.flight.entity.*;

import java.util.Date;
import java.util.List;


public interface FlightDao {

	/**
	 * 查询航班信息
	 *
	 * @return
	 */
	List<FlightInfo> retrieveFlightInfo(String dcity, String acity, Date ddate, String carrier, String opCarrier, int codeShared, Page page, int minId);

	FlightPrice getFlightPrice(int id);

	List<FdCacheInfo> searchFdCache(String depPort, String arrPort);


	List<RouteInfo> searchRoute(String depPort, String arrPort);


	int createFdRequests(List<FdRequest> list);

	int createNfdRequest(int enterpriseId, String carrier, String dport, String aport);


	List<FdResult> searchFdResult(int enterpriseId, CommonSearchCriteria sc);

	List<NfdResult> searchNfdResult(int enterpriseId, CommonSearchCriteria sc);

	List<FdRequest> searchFdRequest(int enterpriseId, CommonSearchCriteria sc);

	int deleteFdRequest(int enterpriseId, int id);

	List<NfdRequest> searchNfdRequestWaitList(int max);

	int setFdRequestDone(int enterpriseId, int id, String remark);

	int setNfdRequestDone(int enterpriseId, int id, String remark);

	/**
	 * 删除全部FD请求（已完成的和创建时间早于指定时间且未完成的）
	 *
	 * @param enterpriseId
	 * @param minDateTime
	 * @return
	 */
	int deleteAllFdRequest(int enterpriseId, Date minDateTime);

	int deleteAllFdResult(int enterpriseId);

	int updateAirlineFlightCount(String carrier, String dport, String aport, int flightCount);

	List<AirlineTable> searchAirline(String carrier);

	List<AirlineTable> searchAirline(String carrier, String dport, String aport, int flightCount);

	int createFd(FareDisplay fd);


	FlightInfoCache searchFlightInfoCache(String dcity, String acity, Date ddate);


	List<SkInfo> searchAirlineSchedules(CommonSearchCriteria sc);
}
